import axios from 'axios'
const api = process.env.REACT_APP_RECORDS_API_URL || 'https://5adc55b8b80f490014fb8812.mockapi.io'
// REACT_APP_RECORDS_API_URL=https://5adc55b8b80f490014fb8812.mockapi.io
// const api = process.env.REACT_APP_RECORDS_API_URL || 'https://api.douban.com'

export const tableList = () =>
  axios.get(`${api}/records`)

export const create = (data) =>
  axios.post(`${api}/records`, data)

export const update = (id, data) => 
  axios.put(`${api}/records/${id}`, data)

export const remove = (id) => 
  axios.delete(`${api}/records/${id}`)

export const movie = () =>
  axios.get(`${api}/v2/movie/subject/1764796`)
